package com.snl.micro.blog.user.dao.repository.impl;

import com.snl.micro.blog.common.protocol.ResponseResult;
import com.snl.micro.blog.common.query.LoginParam;
import com.snl.micro.blog.common.query.UserQuery;
import com.snl.micro.blog.user.dao.mapper.UserMapper;
import com.snl.micro.blog.user.dao.repository.UserRepository;
import com.snl.micro.blog.user.pojo.po.UserInfoPo;
import com.snl.micro.blog.user.pojo.vo.UserVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class UserRepositoryImpl implements UserRepository {

    @Autowired
    private UserMapper userMapper;

    @Override
    public void saveUser(UserInfoPo po) {
        userMapper.saveUser(po);
    }

    @Override
    public void deleteUser(Integer userId) {

    }

    @Override
    public UserInfoPo login(LoginParam param) {
        return userMapper.login(param);
    }

    @Override
    public List<UserInfoPo> query(UserQuery query) {
        List<UserInfoPo> pos = userMapper.query(query);
        return pos;
    }

    @Override
    public void subscrible(Long followerId, Long followingId) {
        userMapper.subscrible(followerId,followingId);
    }

    @Override
    public void unsubscrible(Long followerId, Long followingId) {
        userMapper.unsubscrible(followerId,followingId);
    }
}
